package sto.orz.commons;

import java.util.Locale;
import java.util.ResourceBundle;
import java.util.MissingResourceException;
import org.springframework.context.i18n.LocaleContextHolder;

import sto.orz.Constants;

public class ResourceUtils {
	final static Locale locale = LocaleContextHolder.getLocale();
	final static ResourceBundle resourceBundle = ResourceBundle.getBundle(
			Constants.BUNDLE_KEY, locale);

	public final static String getString(String key) {
		return resourceBundle.getString(key);
	}

	public final static String getStringOrNull(String key) {
		String ret = null;
		try {
			ret = resourceBundle.getString(key);
		} catch (MissingResourceException mre) {
		}
		return ret;
	}
}
